package main

import "fmt"

func main() {

	s1 := Student{"小王", 25, "非洲", '男'}
	s2 := Student{}

	fmt.Printf("s1 is %v \n", s1)
	fmt.Printf("s1 is %T \n", s1)

	var s3 *Student = &Student{"小王吧", 26, "成都", '男'}

	test(s3)
	fmt.Println(s3)

	fmt.Printf("s1 == s3 ? %t \n", &s1 == s3)

	fmt.Printf("s1 %p, s2 %p, s3 %p \n", &s1, &s2, s3)

}

type Student struct {
	name    string
	age     int
	address string
	sex     rune
}

func test(s *Student) {

	//fmt.Printf("s value is  %v , s pointer is %p , s type is %T \n",*s,s,*s)

	fmt.Println(s, "666")

	s.name = "大王八"

	s = nil
}
